package top.hzy520.config;

import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;
import java.util.concurrent.locks.Lock;

/**
 * @Author: HouZeYu
 * @Description: 数据源配置
 * @Date: Created in 17:27 2018/7/7
 */
@Configuration
public class DataSourceConfig{
         @Bean(name = "stockDataSource")
         @ConfigurationProperties(prefix = "spring.datasource.stock")
            public DataSource stockDatasource(){
             return DataSourceBuilder.create().build();
         }

         @Bean(name = "userDataSource")
         @ConfigurationProperties(prefix = "spring.datasource.user")
         public DataSource userDataSource(){return DataSourceBuilder.create().build();}

        @Bean(name = "orderDataSource")
        @ConfigurationProperties(prefix = "spring.datasource.order")
        public DataSource orderDataSource(){return DataSourceBuilder.create().build();}
}
